//
//  MyTabBarController.m
//  DishMenu
//
//  Created by 成都千锋 on 15/10/21.
//  Copyright (c) 2015年 Yes. All rights reserved.
//

#import "MyTabBarController.h"

@interface MyTabBarController ()

@end

@implementation MyTabBarController

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.tabBar.hidden = YES;
        [self setupUI];
    }
    return self;
}
- (void)setupUI
{
    UIView *view = [[NSBundle mainBundle] loadNibNamed:@"TabBarView" owner:nil options:nil].firstObject;
    view.frame = CGRectMake(0, HEIGHT - 40, WIDTH, 40);
    
    for (NSInteger i = 1000; i < 1002; i ++) {
        UIButton *btn = (id)[view viewWithTag:i];
        [btn addTarget:self action:@selector(clicked:) forControlEvents:UIControlEventTouchUpInside];
    }
    [self.view addSubview:view];
}
- (void)clicked:(UIButton *)btn
{
    self.selectedIndex = btn.tag -1000;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
